package com.ruoyi.system.domain;

import com.ruoyi.system.anno.NeedComparedProperty;
import com.ruoyi.system.service.EditDBGroup;
import com.ruoyi.system.service.SaveDBGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @Version: 1.0
 * @Description: 保存/编辑数据库DTO
 */

@Data
public class OperateDBDTO
{
    @NotBlank(message = "数据库标识ID不能为空", groups = {EditDBGroup.class})
    private String id;

    @ApiModelProperty("数据库名称")
    @NotBlank(message = "数据库名称不能为空", groups = {SaveDBGroup.class})
    private String dbName;


    @ApiModelProperty("所属局办")
    @NotBlank(message = "所属局办不能为空", groups = {SaveDBGroup.class})
    private String bureauId;

    @ApiModelProperty("所属局办名称")
    @NotBlank(message = "所属局办名称不能为空", groups = {SaveDBGroup.class})
    private String bureauName;

    @ApiModelProperty("分类")
    @NotBlank(message = "分类不能为空", groups = {SaveDBGroup.class})
    private String classify;

    @NeedComparedProperty(name = "数据库类型")
    @ApiModelProperty("数据库类型")
    @NotBlank(message = "数据库类型不能为空")
    private String dbType;

    @NeedComparedProperty(name = "IP")
    @ApiModelProperty("IP")
    @NotBlank(message = "IP不能为空")
    private String ip;

    @NeedComparedProperty(name = "SCHEMA")
    @ApiModelProperty("SCHEMA")
    @NotBlank(message = "未指定数据库标识")
    private String schemal;

    @NeedComparedProperty(name = "端口")
    @ApiModelProperty("端口")
    @NotBlank(message = "端口不能为空")
    private String port;

    @NeedComparedProperty(name = "用户名")
    @ApiModelProperty("用户名")
    @NotBlank(message = "用户名不能为空")
    private String user;

    @NeedComparedProperty(name = "密码")
    @ApiModelProperty("密码")
    @NotBlank(message = "密码不能为空")
    private String password;

    @NeedComparedProperty(name = "是否为部门库")
    @ApiModelProperty("是否为部门库")
    @NotNull(message = "是否为部门库标识不能为空", groups = {SaveDBGroup.class})
    private Boolean orgDb;

    private String url;

    private String driver;

    private String znodeParent;
}
